/** 
设置收藏页面 
sURL：要收藏的页面链接 
sTitle：要设置的收藏项标题 
*/  
function addFavorite(sURL, sTitle)  
{  
    try  
    {  
        window.external.addFavorite(sURL, sTitle);  
    }  
    catch (e)  
    {  
        try  
        {  
            window.sidebar.addPanel(sTitle, sURL, '');  
        }  
        catch (e)  
        {  
            alert('Add To Favoriteschina Fail,Use the key \'Ctrl+D\' please.');  
        }  
    }  
}  
  
/** 
将页面设为首页 
obj：引发该操作的元素对象 
vrl：要设为首页的页面链接 
*/  
function setHome(obj,vrl){
        try{
                obj.style.behavior='url(#default#homepage)';  
                obj.setHomePage(vrl);  
        }  
        catch(e){ 
                if(window.netscape) {  
                        try {  
                                netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');  
                        }  
                        catch (e)  {  
                        		alert("It\'s forbidden by browser!\nPlease in the browser address bar input\"about:config\" and enter \n set [signed.applets.codebase_principal_support] to\"true\"");  
                        }  
                        var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);  
                        prefs.setCharPref('browser.startup.homepage',vrl);  
                 }  
        }  
}  